package main.Q1401_1500;

public class Q1471_1480 {
    public static void main(String[] args) {
        System.out.println("Question1471：");
        System.out.println("Question1472：");
        System.out.println("Question1473：");
        System.out.println("Question1474：");
        System.out.println("Question1475：商品折扣后的最终价格");
        System.out.println("Question1476：子矩形查询");
        System.out.println("Question1477：");
        System.out.println("Question1478：");
        System.out.println("Question1479：");
        System.out.println("Question1480：");
    }
}

class Question1475 {
    public static int[] finalPrices(int[] prices) {
        int length = prices.length;
        int[] affordPrices = new int[length];
        for (int i = 0; i < length; i++) {
            boolean flag = true;
            for (int j = i + 1; j < length; j++) {
                if (prices[j] <= prices[i]) {
                    affordPrices[i] = prices[i] - prices[j];
                    flag = false;
                    break;
                }
            }
            if (flag) affordPrices[i] = prices[i];
        }
        return affordPrices;
    }
}

class Question1476 {
    int[][] grid;

    public Question1476(int[][] rectangle) {
        grid = rectangle;
    }

    public void updateSubrectangle(int row1, int col1, int row2, int col2, int newValue) {
        for (int i = row1; i <= row2; i++) {
            for (int j = col1; j <= col2; j++) {
                grid[i][j] = newValue;
            }
        }
    }

    public int getValue(int row, int col) {
        return grid[row][col];
    }
}